package com.marstalk.test.demo1;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.DataSourceUtils;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public class CommonQueryService {
	@Autowired
	private JdbcTemplate jdbcTemplate;

	public void hi(int timtout){
		jdbcTemplate.setQueryTimeout(timtout);
		List<Map<String, Object>> maps = jdbcTemplate.queryForList("select 1 from dual;");
		System.out.println(maps);
	}
}
